<template >
	<div>
		<van-nav-bar :title="$route.query.topBarName?$route.query.topBarName:$route.name" left-text="" right-text=""  @click-left="onClickLeft" @click-right="onClickRight">
			<template #left>
				<van-icon v-if="leftIconShow()" name="arrow-left" size="18" />
			</template>
			<template #right>
				<van-icon v-if="leftIconShow()" name="wap-home-o" size="18" />
			</template>
		</van-nav-bar>

	</div>
</template>
<script>
export default {
	data() {
		return {
			currentPath: '',
			rightIcon: true,
		};
	},
	watch: {
		$route(to, from) {
			this.currentPath = to.path;
		},
	},
	created() {
		this.currentPath = this.$route.fullPath;
	},
	methods: {
		leftIconShow(){
			if(this.currentPath =='/home' ||this.currentPath =='/coupon/home' ||this.currentPath =='/personal/home'){
				return false
			}else{
				return true
			}
		},
		rightIconShow(){
			if(this.currentPath =='/home' ||this.currentPath =='/coupon/home' ||this.currentPath =='/personal/home'){
				return false
			}else{
				return true
			}
		},
		onClickLeft() {
			this.$router.back();
		},
		onClickRight() {
			this.$router.push('/home');
		},
	},
};
</script>
<style lang="less">
</style>